home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / library / help / tcl / time / convertclock < prev    next >
Encoding:
Text File  |  1993-10-26  |  3.2 KB  |  59 lines  |  [TEXT/$Tcl]

  1.  
  2.  
  3.           convertclock dateString ?GMT|{}? ?baseClock?
  4.                Convert dateString  to  an  integer  clock  value  (see
  5.                getclock).   This  command can parse and convert virtu-
  6.                ally any standard date and/or time  string,  which  can
  7.                include  standard  time zone mnemonics.  If only a time
  8.                is specified, the current  date  is  assumed.   If  the
  9.                string does not contain a time zone mnemonic, the local
  10.                time zone is assumed, unless the GMT argument is speci-
  11.                fied,  in  which  case  the  clock  value is calculated
  12.                assuming  that  the  specified  time  is  relative   to
  13.                Greenwich  Mean Time.  If baseClock is specified, it is
  14.                taken as the current clock value.  This is  useful  for
  15.                determining the time on a specific day.
  16.  
  17.                The character string consists of zero or more  specifi-
  18.                cations of the following form:
  19.  
  20.                time - A time of day, which is of the form hh[:mm[:ss]]
  21.                [meridian]  [zone]  or  hhmm  [meridian] [zone].  If no
  22.                meridian is specified, hh is interpreted on  a  24-hour
  23.                clock.
  24.  
  25.                date - A specific month and  day  with  optional  year.
  26.                The  acceptable  formats  are  mm/dd[/yy],  yyyy/mm/dd,
  27.                monthname dd[, yy], dd  monthname  [yy],  and  day,  dd
  28.                monthname  yy.   The  default year is the current year.
  29.                If the year is less then 100, then 1900 is added to it.
  30.  
  31.                relative time - A specification relative to the current
  32.                time.   The format is number unit; acceptable units are
  33.                year, fortnight, month, week,  day,  hour,  minute  (or
  34.                min),  and  second (or sec).  The unit can be specified
  35.                as a singular or plural, as in 3 weeks.   These  modif-
  36.                iers may also be specified: tomorrow, yesterday, today,
  37.                now, last, this, next, ago.
  38.  
  39.                The actual date is calculated according to the  follow-
  40.                ing  steps.   First,  any  absolute date and/or time is
  41.                processed and converted.  Using that time as the  base,
  42.                day-of-week  specifications  are added.  Next, relative
  43.                specifications are used.  If a date or  day  is  speci-
  44.                fied,  and  no absolute or relative time is given, mid-
  45.                night is used.  Finally, a  correction  is  applied  so
  46.                that  the  correct  hour  of  the day is produced after
  47.                allowing for daylight savings time differences.
  48.  
  49.                convertclock ignores case when parsing all words.   The
  50.                names  of the months and days of the week can be abbre-
  51.                viated to their  first  three  letters,  with  optional
  52.                trailing  period.   Periods are ignored in any timezone
  53.                or meridian values.  The only dates in the  range  1902
  54.                and 2037 may be converted. Some examples are:
  55.  
  56.                    convertclock "14 Feb 92"
  57.                    convertclock "Feb 14, 1992 12:20 PM PST"
  58.                    convertclock "12:20 PM Feb 14, 1992"
  59.